package com.sservice.web.controller.admin;

import com.sservice.base.entity.dto.BaseResult;
import com.sservice.base.entity.dto.ListResult;
import com.sservice.commonBusiness.vo.CategoryVo;
import com.sservice.model.entity.UserWx;
import com.sservice.service.service.ICommissionService;
import com.sservice.service.service.IUserWxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/admin/userWx")
public class UserWxController {

//    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    ICommissionService iCommissionService;
    @Autowired
    private IUserWxService service;

    @ResponseBody
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public BaseResult<Integer> update(UserWx user) {
        int service_res = service.updateByPrimaryKeySelective(user);
        BaseResult<Integer> res = new BaseResult<Integer>(true, service_res);
        return res;
    }

    @ResponseBody
    @RequestMapping(value = "/history/commission", method = RequestMethod.GET)
    public ListResult commission(CategoryVo arg) {

        return iCommissionService.userCommissionApply(arg);
    }

}
